package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SupSupplierMapper;
import com.ruoyi.system.domain.SupSupplier;
import com.ruoyi.system.service.ISupSupplierService;

/**
 * 供货商档案Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
@Service
public class SupSupplierServiceImpl implements ISupSupplierService 
{
    @Autowired
    private SupSupplierMapper supSupplierMapper;

    /**
     * 查询供货商档案
     * 
     * @param supplierId 供货商档案主键
     * @return 供货商档案
     */
    @Override
    public SupSupplier selectSupSupplierBySupplierId(Long supplierId)
    {
        return supSupplierMapper.selectSupSupplierBySupplierId(supplierId);
    }

    /**
     * 查询供货商档案列表
     * 
     * @param supSupplier 供货商档案
     * @return 供货商档案
     */
    @Override
    public List<SupSupplier> selectSupSupplierList(SupSupplier supSupplier)
    {
        return supSupplierMapper.selectSupSupplierList(supSupplier);
    }

    /**
     * 新增供货商档案
     * 
     * @param supSupplier 供货商档案
     * @return 结果
     */
    @Override
    public int insertSupSupplier(SupSupplier supSupplier)
    {
        supSupplier.setCreateTime(DateUtils.getNowDate());
        return supSupplierMapper.insertSupSupplier(supSupplier);
    }

    /**
     * 修改供货商档案
     * 
     * @param supSupplier 供货商档案
     * @return 结果
     */
    @Override
    public int updateSupSupplier(SupSupplier supSupplier)
    {
        supSupplier.setUpdateTime(DateUtils.getNowDate());
        return supSupplierMapper.updateSupSupplier(supSupplier);
    }

    /**
     * 批量删除供货商档案
     * 
     * @param supplierIds 需要删除的供货商档案主键
     * @return 结果
     */
    @Override
    public int deleteSupSupplierBySupplierIds(Long[] supplierIds)
    {
        return supSupplierMapper.deleteSupSupplierBySupplierIds(supplierIds);
    }

    /**
     * 删除供货商档案信息
     * 
     * @param supplierId 供货商档案主键
     * @return 结果
     */
    @Override
    public int deleteSupSupplierBySupplierId(Long supplierId)
    {
        return supSupplierMapper.deleteSupSupplierBySupplierId(supplierId);
    }
}
